package com.atguigu.lease.web.admin.service.impl;

import com.atguigu.lease.web.admin.vo.user.UserInfoQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.lease.model.entity.UserInfo;
import com.atguigu.lease.web.admin.service.UserInfoService;
import com.atguigu.lease.web.admin.mapper.UserInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liubo
 * @description 针对表【user_info(用户信息表)】的数据库操作Service实现
 * @createDate 2023-07-24 15:48:00
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
        implements UserInfoService {
    @Autowired
    UserInfoMapper userInfoMapper;

    @Override
    public IPage<UserInfo> pageUserInfo(Page<UserInfo> userInfoPage, UserInfoQueryVo queryVo) {
        System.out.println(queryVo.getPhone() + "这是手机号码！！！！！！！！！！！！！！！！！！！！！！！！！！！！！");
        return userInfoMapper.selectPage(userInfoPage, new LambdaQueryWrapper<UserInfo>().likeRight(queryVo.getPhone() != null, UserInfo::getPhone, queryVo.getPhone()).eq(queryVo.getStatus() != null, UserInfo::getStatus, queryVo.getStatus()));
    }
}




